# Python Project
# 撰写人：Blackstar
# 借书方案
# 有m本书，分给三个人，每人每次只能借1本或者不借
# a代表第一个人借的书，b代表第二个人借的书,c代表第三个人借的书，m代表种次
h = input('总共的书：')
h = int(h)
h += 1
m = 0
for a in range(0, h):
    for b in range(0, h):
        for c in range(0, h):
            if (a == 0 and b == 0 and c == 0):
                print('A:', a, '，B：', b, 'C:', c)
                m += 1
            if (a == 0 and b == 0 and c != a or a == 0 and c == 0 and b != a or b == 0 and c == 0 and c != a):
                print('A:', a, '，B：', b, 'C:', c)
                m += 1
            if (a != b and a != c and b != c):
                print('A:', a, '，B：', b, 'C:', c)
                m += 1
print(m, '种')